# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

_pkgname=RangeHTTPServer
pkgname=python-rangehttpserver
pkgver=1.3.3
pkgrel=1
pkgdesc='SimpleHTTPServer with support for Range requests'
url='https://github.com/danvk/RangeHTTPServer/'
arch=('any')
license=('Apache')
depends=('python')
makedepends=('python' 'python-setuptools')
checkdepends=('python-pytest' 'python-requests')
source=(${pkgname}-${pkgver}.tar.gz::https://github.com/danvk/RangeHTTPServer//archive/${pkgver}.tar.gz)
sha256sums=('5232af4db9a87d0ee84b6d242b58c48c874062de74bf723a1205b7fdae1e872f')
sha512sums=('5d179766640bd408d70f083c9fbd7822cdc14a3205d8134f5e20e3c2e22a9e360d1c458b07b028f5f2242e1aa94e623e3ac0f7453e83beabd67477d0f8c027c3')

build() {
  cd ${_pkgname}-${pkgver}
  python setup.py build
}

check() {
  cd ${_pkgname}-${pkgver}
  pytest -v
}

package() {
  cd ${_pkgname}-${pkgver}
  python setup.py install --root="${pkgdir}" --optimize=1 --skip-build
  install -Dm 644 README -t "${pkgdir}/usr/share/doc/${pkgname}"
}
